const express = require('express')
const bodyParser = require('body-parser')
const app=express();
app.use(bodyParser.urlencoded({extended:false}))
const list=[
	{
		id:"001",
		title:'四川泸县6级地震已致3死88伤'
	},
	{
		id:"002",
		title:'3名航天员离开空间站前敬礼致谢'
	},
	{
		id:"003",
		title:'官方:本轮疫情场所聚集性感染明显'
	},
	{
		id:"004",
		title:'美高官2次秘密致电中方?外交部回应'
	}
]

app.all("*",function(req,res,next){
	res.header("Access-Control-Allow-Origin", "http://localhost:3000");
	next();
})
app.get('/list',function(req,res){
	res.json({status:200,list})
})
app.get('/num',function(req,res){
	res.json({status:200})
})
app.listen(3001,function(){
	console.log("服务已经开启")
})